<?php
class module_enhance extends module {
		
	function submit() {
		$vars = (array) request::get("*", "post");
		foreach($vars as $k => $v) {
			if (substr($k, 0, 4) == "tag_") {
				$vars[$k] = $v === "true" ? 1 : 0;
			}
		}
		$userAuthRequest = new request(array("module" => "user", "action" => "getUid"));
		$user_id = module::load($userAuthRequest);
		if ($user_id === false) {
			$user_id = null;
		}
		$vars["user_id"] = $user_id;
		$vars["ip"] = $_SERVER["REMOTE_ADDR"];
		$vars["time"] = date("Y-m-d H:i:s");
		$enhance = new enhance();
		$result = $enhance->insert($vars) ? true : false;
		$this->attach("result", $result);	
		$this->output();
	}
	
	function process() {
		$eh = new enhance();
		$helper = new enhance_helper();
		$since = '2010-01-01 00:00:00';
		
		// loop new added video's since date
		foreach($eh->getUniqueVideoList($since) as $video) {
			echo $video->video;
			
			foreach($eh->getEditsForVideo($video->video) as $edit) {
				
			}			
		}
	}
	
}

class enhance_helper {
	private $artists;
}
?>